package com.ms.common.enums;

public enum StatusEnum {

	FORBIDDEN(0, "禁用"),
	ENABLE(1, "启用");

	private final Integer value;
	private final String text;

	private StatusEnum(int value, String text) {
		this.value = value;
		this.text = text;
	}

	public Integer getValue() {
		return value;
	}

	public String getText() {
		return text;
	}

	private static final StatusEnum[] ENUMS = StatusEnum.values();

	public static StatusEnum matchEnum(int value) {
		for (StatusEnum ele : ENUMS) {
			if (ele.value == value) {
				return ele;
			}
		}
		return StatusEnum.FORBIDDEN;
	}

}
